package io.kiki.sba.registry.common.model.sessionserver;

import io.kiki.sba.registry.common.model.TraceTimes;
import io.kiki.sba.registry.common.model.dataserver.DatumVersion;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Collections;
import java.util.Map;

/**
 * request to notify session server when data changed
 */
@Setter
@Getter
public class DataChangeRequest implements Serializable {

    private static final long serialVersionUID = -1L;

    private final Map<String, DatumVersion> dataInfoIdToDatumVersionMap;

    private final String dataCenter;

    private final TraceTimes times;

    public DataChangeRequest(String dataCenter, Map<String, DatumVersion> dataInfoIdToDatumVersionMap, TraceTimes times) {
        this.dataCenter = dataCenter;
        this.dataInfoIdToDatumVersionMap = dataInfoIdToDatumVersionMap;
        this.times = times;
    }

    public Map<String, DatumVersion> getDataInfoIdToDatumVersionMap() {
        return Collections.unmodifiableMap(dataInfoIdToDatumVersionMap);
    }


}
